<template>
  <div>
    <el-button type="text" @click="to">编辑</el-button>
    <em class="block-col"/>
    <eForm ref="form" :sup_this="sup_this" :is-add="false" :dicts="dicts"/>
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    },
    dicts: {
      type: Array,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.getDepts()
      _this.form = {
        jobId: this.data.jobId,
        name: this.data.name,
        sort: this.data.sort,
        enabled: this.data.enabled,
        createdAt: this.data.createdAt,
        dept: { jobId: this.data.dept.jobId }
      }
      _this.deptId = this.data.dept.jobId
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
